﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Binding;
using Binding.Interfaces;

namespace UserControlExamples.UserControls
{
    public partial class CustomerListUC : System.Web.UI.UserControl, IBindingContainer
    {
        private object m_DataContext;
        public object DataContext
        {
            get { return m_DataContext; }
            set { m_DataContext = value; }
        }

        protected override void OnLoad(EventArgs e)
        {
            this.RegisterForBinding();
            base.OnLoad(e);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                m_DataContext = ViewModelProviders.CustomerListViewModelProvider.GetDummyCustomerListViewModel();
        }

    }
}